package com.graduation.mathematics.ui.activity;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.graduation.mathematics.R;
import com.graduation.mathematics.base.BaseActivity;
import com.graduation.mathematics.bean.FunnyExam;

import butterknife.BindView;

public class FunnyExamDetailActivity extends BaseActivity {

    public static final String KEY = "funnyExam";
    public static final String BUNDLE_KEY = "bundle";

    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.img_back)
    ImageView imgBack;
    @BindView(R.id.tv_question)
    TextView tvQuestion;
    @BindView(R.id.tv_knowledgePoint)
    TextView tvKnowledgePoint;
    @BindView(R.id.tv_degree)
    TextView tvDegree;
    @BindView(R.id.tv_content)
    TextView tvContent;

    private FunnyExam funnyExam;

    @Override
    protected int getLayout() {
        return R.layout.activity_exam_detail;
    }

    @Override
    protected void initDataAndEvent() {
        tvTitle.setText("题目详情");
        imgBack.setOnClickListener(v -> finish());


        funnyExam = (FunnyExam) getIntent().getBundleExtra(BUNDLE_KEY).getSerializable(KEY);
        tvQuestion.setText(funnyExam.getQuestionId() + "." + funnyExam.getQuestion());
        tvKnowledgePoint.setText(funnyExam.getKnowledgePoint());
        tvDegree.setText("难度系数：" + funnyExam.getDegree());
    }
}
